﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<CarInView>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	<%:Html.Resource("Orders_add")%>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MoreLinks" runat="server"> 
    <% Html.RenderAction("Menu","CarView"); %>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="MainContent" runat="server">
	<h2>
		<%:Html.Resource("Orders_add")%></h2>
		<h2 style="color:Red"><%= TempData["Error"] %></h2>
	
	
	<%if (Model != null)
	  { %>
	<table>
		<tr>
			<td>
				<%--<img alt="<%: Model.CarName %>" src="/picshow/image/<%: Model.CarID %> " />--%>
                
				<img alt="<%: Model.CarName %>" src="<%: Html.PicShow(Model.CarID) %> " />
			</td>
			<td>
				<%: Html.Resource("CarViewListItemPriceText")%>
				<%: Model.CarPrice%>
				<%: Html.Resource("CarViewListItemPriceUnitText") %>
			</td>
			<td>
			</td>
		</tr>
		<tr>
			<td colspan="3">
				<%: Html.Resource("CarViewListItemIDText")%>
				<%: Model.CarID%>
			</td>
		</tr>
		<tr>
			<td colspan="3">
				<%: Html.Resource("CarViewListItemBrandText")%>
				<%: Model.CarName%>
			</td>
		</tr>
		<tr>
			<td colspan="3">
				<%: Html.Resource("CarViewListItemDescriptionText")%>
				<%: Model.CarDescription%>
			</td>
		</tr>
		<tr>
			<td colspan="3">
				<% 
					string newurl = "CarCart/AddToOrder/" + Model.CarID;
					//using (Html.BeginForm("Index", newurl, FormMethod.Post))
					using (Html.BeginForm("AddToOrder", "CarCart", FormMethod.Post, new { id = Model.CarID }))
					{ %>
				<%: Html.Resource("CarViewCount")%>
				<%= Html.TextBox("count", 1)%>
				/
				<%: Model.CarCount%>
				<br />
				<%: Html.Resource("Orders_add_starttime")%>
				<%: Html.TextBox("starttime") %>
				<br />
				<%: Html.Resource("Orders_add_Howlong")%> 
				<%= Html.TextBox("days")%> <%: Html.Resource("CarViewListItemPriceUnitText") %> 
				<br />
				<input type="submit" name="key" title="hello" />
				<%  } %>
			</td>
		</tr>
	</table>
	<%}
	  else
	  { %>
	<h1>
		<%:string.Format(Resources.CarViewDetailNoCarError) %></h1>
	<%} %>
</asp:Content>
